Skip to content

[Uid] getId(): ?Uuid missing // need test getId: ?Ulid #14847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 18, 2021
Merged

[Uid] getId(): ?Uuid missing // need test getId: ?Ulid #14847

merged 1 commit into from
Jan 18, 2021

Conversation

Mausino
Copy link
Contributor

@Mausino Mausino commented Jan 17, 2021

I added all code as in example, but i had still issue with api-platform that getId() field is wrong defined...
I have no experience with ULID !!! Please test my solution for

This solved my issue.. and now i am able create, update or delete record without any other issues.
I think that this will save lot of time for new users... because fist i thinked that must be

    public function getId(): ?UuidV4Generator
    {
        return $this->id;
    }

but with this my code was still broken... now i know that there must be if you change primary identifier from Int to Uuid

use Symfony\Component\Uid\Uuid;
public function getId(): ?Uuid
        {
            return $this->id;
        }

....
also i think need to done the section of Uuid and Ulid for private $someProperty; getter and setter

I added all code as in example, but i had still issue with api-platform that getId() field is wrong defined...
I have no experience with ULID !!! Please test my solution for

This solved my issue.. and now i am able create, update or delete record without any other issues.
I think that this will save lot of time for new users... because fist i thinked that must be
    public function getId(): ?UuidV4Generator
    {
        return $this->id;
    }

but with this my code was still broken...  now i know that there must be if you change primary identifier from Int to Uuid
use Symfony\Component\Uid\Uuid;
public function getId(): ?Uuid
        {
            return $this->id;
        }

.... 
also i think need to done the section of Uuid and Ulid for  private $someProperty; getter and setter
Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks reasonable to me 👌🏻

@carsonbot carsonbot changed the title getId(): ?Uuid missing // need test getId: ?Ulid [Uid] getId(): ?Uuid missing // need test getId: ?Ulid Jan 18, 2021
@javiereguiluz javiereguiluz modified the milestones: 5.1, 5.2 Jan 18, 2021
@javiereguiluz
Copy link
Member

Changes look reasonable to me too. Thanks Miky and congrats on your first Symfony Docs contribution 🎉

@javiereguiluz javiereguiluz merged commit e115a03 into symfony:5.2 Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants